package edu.iscas.xcheck.analysis.dom.checker;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import edu.iscas.xcheck.analysis.model.StateIssue;

public class XBIResult {

	Map<String, List<String>> layoutIssues;
	Map<String, List<String>> contentIssues;
	List<String> behaviorIssues;
	
	Map<Integer, StateIssue> stateIssues;

	public XBIResult() {
		layoutIssues = new HashMap<String, List<String>>();
		contentIssues = new HashMap<String, List<String>>();
		behaviorIssues = new ArrayList<String>();
		stateIssues = new HashMap<>();
	}
	
	public void addLayoutIssues(String statePair, List<String> issues) {
		List<String> oldIssuesList = layoutIssues.get(statePair);
		if(oldIssuesList == null){
			oldIssuesList = new ArrayList<String>();
			layoutIssues.put(statePair, oldIssuesList);
		}
		oldIssuesList.addAll(issues);
	}
	
	public void addContentIssues(String statePair, List<String> issues) {
		contentIssues.put(statePair, issues);
	}
	
	public void addBehaviorIssues(List<String> issues) {
		behaviorIssues.addAll(issues);
	}
	
	public Map<String, List<String>> getLayoutIssues() {
		return layoutIssues;
	}
	
	public Map<String, List<String>> getContentIssues() {
		return contentIssues;
	}
	
	public List<String> getBehaviorIssues() {
		return behaviorIssues;
	}
	
	public Map<Integer, StateIssue> getStateIssues() {
		return stateIssues;
	}

	public void setStateIssues(Map<Integer, StateIssue> stateIssues) {
		this.stateIssues = stateIssues;
	}

}
